package com.tongji.housediy.view
{
	import com.tongji.housediy.model.BrandModel;
	import com.tongji.housediy.model.SearchResultModel;
	import com.tongji.housediy.vo.GoodsSort;
	
	import mx.binding.utils.BindingUtils;
	import mx.collections.ArrayCollection;
	
	import org.robotlegs.mvcs.Mediator;
	
	/**
	 * 
	 * @author yanghanbing
	 * 2011/5/12
	 */ 
	public class GoodsBrandMediator extends Mediator
	{
		[Inject]
		public var view:GoodsBrandComp;
		
		[Inject]
		public var brandModel:BrandModel;
		
		[Bindable]
		public var goodsList:ArrayCollection;
		
		[Bindable]
		public var typeName:String;
		
		[Inject]
		public var searchModel:SearchResultModel;
		override public function onRegister():void
		{
			goodsList = (brandModel.goodsList.getItemAt(brandModel.currentGoodsIndex) as GoodsSort).goodsList;
			typeName = (brandModel.goodsList[brandModel.currentGoodsIndex] as GoodsSort).typeName;			
			//BindingUtils.bindProperty(view.upList.dataGroup, "dataProvider", this, "goodsList");
            BindingUtils.bindProperty(view.typeName, "text", this, "typeName");
		}
	}
}